package com.github.ghsea.sso.client.mvcsample;

import java.util.Arrays;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author guhai
 * @since 2021/6/13 1:16
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @RequestMapping(value = "/list")
    @RequiresPermissions("user:list3")
    public List<User> listUsers() {
        User u1 = new User();
        u1.setAge(25).setName("ghsea");

        User u2 = new User();
        u2.setAge(27).setName("ghsea2");

        return Arrays.asList(u1, u2);
    }

}
